package org.springblade.modules.repair.vo.statistics;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @Description
 * @Author ysq
 * @Date 2022/8/26
 **/
@Data
public class DayWorkDetailVO {

	@ApiModelProperty(value = "类型 1: 保养, 2: 维修, 4: 部件更换")
	private Integer type;

	@ApiModelProperty(value = "作业工单数")
	private Integer orderCount;

	@ApiModelProperty(value = "作业时长(小时)")
	private BigDecimal workTime;

	@ApiModelProperty(value = "作业时长(分钟)")
	private Integer workTimeMin;

	@ApiModelProperty(value = "平均作业时长")
	private BigDecimal divWorkTime;

	public BigDecimal getWorkTime() {
		if (this.workTime == null) {
			this.workTime = BigDecimal.ZERO.setScale(2);
		}
		return workTime;
	}

	public void setWorkTime(BigDecimal workTime) {
		this.workTime = workTime.divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

	public BigDecimal getDivWorkTime() {
		if (this.divWorkTime == null) {
			this.divWorkTime = BigDecimal.ZERO.setScale(2);
		}
		return divWorkTime;
	}

	public void setDivWorkTime(BigDecimal divWorkTime) {
		this.divWorkTime = divWorkTime.divide(new BigDecimal("60"), 2, BigDecimal.ROUND_HALF_UP);
	}

}
